--[[/**
-- * 
* 根据距离修正伤害
 *
-- *
-- */]]

---@class BuffEffect282100 : BaseBuffEffect
BuffEffect282100 = ClientFight.CreateClass("BuffEffect282100", ClientFight.BaseBuffEffect)
local t = BuffEffect282100

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...};
    local validDistance = buff.buffBean.f_BuffEffectValue[1];
    local damageRatio = buff.buffBean.f_BuffEffectValue[2];
    local fightResult = parameters[3];

    local target = buff.target;
    local distance = DistanceUtil.countDistance(buff.skill.position, target.position);
    if (distance > toRatio(validDistance)) then
    return IBuffEffect.FAIL;
    end
    if (fightResult.damage <= 0) then
    return IBuffEffect.SUCCESS_ATTRI_HAS_CHANGE;
    end
    local modifiedDamage = (fightResult.damage * toRatio(damageRatio));
    fightResult.damage = fightResult.damage + modifiedDamage;
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()